import api from "../api.js" //先导入封装好的

const login = async (param) => { //登录
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/login',
		method: "POST",
		type: "application/x-www-form-urlencoded",
		data: param
	})
	return data
}
const getUserInfo = async (param) => { //注册
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/getUserInfo',
		method: "POST",
		type: "application/x-www-form-urlencoded",
		data: param
	})
	return data
}
const updateUserInfo = async (param) => { //修改个人信息
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/updateUserInfo',
		method: "POST",
		data: param
	})
	return data
}
// 获取验证码
const verificationCode = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/getVerificationCode/"+ param,
		// method: "POST",
		// data: param
	})
	return data
}
// 注册账号
const register = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/register",
		method: "POST",
		data: param
	})
	return data
}
// 账号密码登录
const loginByPassword = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/loginByPassword",
		method: "POST",
		data: param
	})
	return data
}
// 账号验证码登录
const loginByVerificationCode = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/loginByVerificationCode",
		method: "POST",
		data: param
	})
	return data
}
// 微信登录
const loginByWX = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/loginByWX",
		method: "POST",
		data: param
	})
	return data
}
// 重置密码
const updatePassword = async(param)=>{
	let data = await api.api({
		url:"/jeecg-boot/api/adopt/updatePassword",
		method: "POST",
		data: param
	})
	return data
}

export {
	verificationCode,
	register,
	loginByPassword,
	loginByVerificationCode,
	loginByWX,
	updatePassword
}